package com.example.poverty.service.impl;

import com.example.poverty.dao.LeaveManagementMapper;
import com.example.poverty.entity.LeaveManagement;
import com.example.poverty.service.LeaveManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前端  请假单  接口实现
 */
@Service
public class LeaveManagementServiceImpl implements LeaveManagementService {

    @Autowired
    private LeaveManagementMapper leaveManagementMapper;

    @Override
    public boolean insert(LeaveManagement leaveManagement) {
        return leaveManagementMapper.insert(leaveManagement) > 0;
    }

    @Override
    public boolean update(LeaveManagement leaveManagement) {
        return leaveManagementMapper.update(leaveManagement) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return leaveManagementMapper.delete(id) > 0;
    }

    @Override
    public LeaveManagement selectByPrimaryKey(Integer id) {
        return leaveManagementMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<LeaveManagement> allLeaveManagement() {
        return leaveManagementMapper.allLeaveManagement();
    }

    @Override
    public LeaveManagement getByName(String name) {
        return leaveManagementMapper.getByName(name);
    }
}
